package cn.fl.fgi.transform;

import cn.cmm.base.framework.utils.DateUtils;
import cn.fl.fgi.api.dto.FgiBusInfoDTO;
import cn.fl.fgi.vo.FgiBusInfoVO;

import java.text.DecimalFormat;

/**
 * @description 业务信息Transform
 * @author fengzuoxiang
 * @date 10:00 2020/4/4
 * @version V1.0
 */
public class FgiBusInfoVOTransform {


	public static FgiBusInfoVO toVO(FgiBusInfoDTO fgiBusInfoDTO) {
		FgiBusInfoVO fgiBusInfoVO = null;
		if (fgiBusInfoDTO != null) {
			fgiBusInfoVO = new FgiBusInfoVO();
			DecimalFormat df = new DecimalFormat("0.00");
			fgiBusInfoVO.setUserIdcardHash(fgiBusInfoDTO.getUserIdcardHash());
			fgiBusInfoVO.setGuaranteeType(fgiBusInfoDTO.getGuaranteeType());
			fgiBusInfoVO.setGuaranteeMoney(df.format(fgiBusInfoDTO.getGuaranteeMoney()));
			fgiBusInfoVO.setGuaranteeSurplusMoney(df.format(fgiBusInfoDTO.getGuaranteeSurplusMoney()));
			fgiBusInfoVO.setShareProportion(fgiBusInfoDTO.getShareProportion());
			fgiBusInfoVO.setGuaranteeRate(df.format(fgiBusInfoDTO.getGuaranteeRate()));
			fgiBusInfoVO.setFinancePurpose(fgiBusInfoDTO.getFinancePurpose());
			fgiBusInfoVO.setStartTime(DateUtils.formatDateToString(fgiBusInfoDTO.getStartTime(),DateUtils.YYYY_MM_DDHHMMSS));
			fgiBusInfoVO.setEndTime(DateUtils.formatDateToString(fgiBusInfoDTO.getEndTime(),DateUtils.YYYY_MM_DDHHMMSS));
			fgiBusInfoVO.setIsAgriculture(fgiBusInfoDTO.getIsAgriculture());
			fgiBusInfoVO.setIsMediumCompany(fgiBusInfoDTO.getIsMediumCompany());
			fgiBusInfoVO.setIsTinyCompany(fgiBusInfoDTO.getIsTinyCompany());
			fgiBusInfoVO.setIsCompositeGuarantees(fgiBusInfoDTO.getIsCompositeGuarantees());
			fgiBusInfoVO.setIsHouseGuarantees(fgiBusInfoDTO.getIsHouseGuarantees());
			fgiBusInfoVO.setIsInternetGuarantees(fgiBusInfoDTO.getIsInternetGuarantees());
			fgiBusInfoVO.setIsBankFinance(fgiBusInfoDTO.getIsBankFinance());
			fgiBusInfoVO.setPassiveIsFirst(fgiBusInfoDTO.getPassiveIsFirst());
			fgiBusInfoVO.setPassiveIsScience(fgiBusInfoDTO.getPassiveIsScience());
			fgiBusInfoVO.setPassiveIsLiterature(fgiBusInfoDTO.getPassiveIsLiterature());
			fgiBusInfoVO.setCreditLevel(fgiBusInfoDTO.getCreditLevel());
			fgiBusInfoVO.setSecuredUser(fgiBusInfoDTO.getSecuredUser());
			fgiBusInfoVO.setCreateTime(DateUtils.formatDateToString(fgiBusInfoDTO.getCreateTime(),DateUtils.YYYY_MM_DDHHMMSS));
			fgiBusInfoVO.setBatchNum(fgiBusInfoDTO.getBatchNum());
			fgiBusInfoVO.setAsynMessage(fgiBusInfoDTO.getAsynMessage());
			fgiBusInfoVO.setBusSource(fgiBusInfoDTO.getBusSource());
			fgiBusInfoVO.setBusSourceId(fgiBusInfoDTO.getBusSourceId());
			fgiBusInfoVO.setBusSourceType(fgiBusInfoDTO.getBusSourceType());
			fgiBusInfoVO.setCstId(fgiBusInfoDTO.getCstId());
			fgiBusInfoVO.setCstNm(fgiBusInfoDTO.getCstNm());
			fgiBusInfoVO.setFundId(fgiBusInfoDTO.getFundId());
			fgiBusInfoVO.setFundNm(fgiBusInfoDTO.getFundNm());
		}
		return fgiBusInfoVO;
	}

}
